//
//  IZHIMOfficialManager.h
//  ZHIMCore
//
//  Created by Husky on 2021/8/17.
//

#import <Foundation/Foundation.h>
#import "ZHIMOfficialManagerDelegate.h"
#import "ZHIMOfficial.h"

NS_ASSUME_NONNULL_BEGIN

@protocol IZHIMOfficialManager <NSObject>

/// 添加回调代理
/// @param delegate 要添加的代理
- (void)addDelegate:(id<ZHIMOfficialManagerDelegate>)delegate;


/// 移除回调代理
/// @param delegate 要移除的代理
- (void)removeDelegate:(id<ZHIMOfficialManagerDelegate>)delegate;


/// 搜索公众号
/// @param keywords 关键字
/// @param pageIndex 页码
/// @param pageSize 每页个数
/// @param completion 搜索回调
- (void)searchOfficials:(NSString *)keywords pageIndex:(NSInteger)pageIndex pageSize:(NSInteger)pageSize forResult:(void (^)(NSArray *officials, NSError *error))completion;


/// 关注公众号
/// @param official 公众号
/// @param completion 关注结果回调
- (void)followOfficial:(ZHIMOfficial *)official forResult:(void (^)(NSError *error))completion;


/// 取消关注公众号
/// @param official 公众号
/// @param completion 关注结果回调
- (void)cancelFollowOfficial:(ZHIMOfficial *)official forResult:(void (^)(NSError *error))completion;


/// 从服务器获取自己关注的公众号
/// @param pageIndex 页码
/// @param pageSize 每页个数
/// @param completion 完成的回调
- (void)getFollowedOfficialsFromServerWithPage:(NSInteger)pageIndex
                                 pageSize:(NSInteger)pageSize
                               completion:(void (^)(NSArray *officials, NSError *error))completion;


/// 查询本地存储的公众号
/// @param keyWords 关键字
- (NSArray *)getOfficialsByKeyWords:(NSString *)keyWords pageIndex:(NSInteger)pageIndex pageSize:(NSInteger)pageSize;

@end

NS_ASSUME_NONNULL_END
